import { NTransfer } from "naive-ui";
import type { TransferProps } from "naive-ui";
import type { OmitHTMLAttributes } from "../types";
export type TransferFactoryConstructorType = {
  props?: TransferProps;
  attrs?: OmitHTMLAttributes<"onChange">;
};
export class TransferFactory {
  private attrs: OmitHTMLAttributes<"onChange"> = {};
  private props: TransferProps = {};
  constructor(data?: TransferFactoryConstructorType) {
    if (data?.props) this.setProps(data.props);
    if (data?.attrs) this.setAttrs(data.attrs);
  }
  setAttrs(attrs: OmitHTMLAttributes<"onChange">) {
    this.attrs = attrs;
    return this;
  }
  setProps(props: TransferProps) {
    this.props = props;
    return this;
  }
  create() {
    return <NTransfer {...this.props} {...this.attrs}></NTransfer>;
  }
}
